package controllers

import (
	"fmt"
	"fxynewbee/models"

	"github.com/astaxie/beego"
	"github.com/astaxie/beego/orm"
)

type MainController struct {
	beego.Controller
}

func (c *MainController) Fun1() {
	o := orm.NewOrm()
	newuser := models.User{}
	newuser.Username = "fxy"
	newuser.Password = "123"
	_, err := o.Insert(&newuser)
	if err != nil {
		beego.Info("insert error:", err)
		return
	}
	c.Data["mystr"] = "fxy's beego1"
	c.TplName = "test.html"
}
func (c *MainController) Fun2() {
	fmt.Printf("hytbyuny\n")
	c.Data["mystr"] = "fxy's beego2 login success"
	c.TplName = "test01.html"
	fmt.Printf("hytbyuny\n")

}
func (c *MainController) Fun3() {
	c.Data["mystr"] = "fxy's beego3 regster user"
	c.TplName = "test01.html"
}
